package com.lst.api.vo.response;

import com.lst.api.entity.SysUser;
import com.lst.api.vo.AccessTokenVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: Frank
 * @date: 2019/09/24 13:51
 * @version: V1.0
 */
@Data
@NoArgsConstructor
public class UserLoginResponse {

    @ApiModelProperty(name = "userId", value = "用户id", required = true, dataType = "Long")
    private long userId;

    @ApiModelProperty(name = "accessTokenVo", value = "登录凭据对象", required = true, dataType = "AccessTokenVo")
    private AccessTokenVo accessTokenVo;

    public UserLoginResponse(SysUser sysUser, AccessTokenVo accessTokenVo) {
        if (sysUser == null) {
            return;
        }
        this.userId = sysUser.getUserId();
        this.accessTokenVo = accessTokenVo;
    }
}
